<template>
  <!-- 患者辅助检查详情 -->
  <section class="patient-layout">
    <div>
      <patientBasicInfo :cureId="cureId" :patientId="patientId" @init="getAllergy"></patientBasicInfo>
    </div>
    <div style="width:0;">
      <table border="0" width="100%">
        <tr>
          <td>
            <h3 style="margin:0;">辅助检查</h3>
          </td>
          <td style="text-align:right;">
            <el-button @click="$router.back()">
              <i class="el-icon-arrow-left"></i>
              <span>返回</span>
            </el-button>
          </td>
        </tr>
      </table>
      <br>
      <el-tabs type="card">
        <el-tab-pane v-for="(item,index) in dataList" :key="index" :label="item.payStatusDisplay" :name="index+''">
          <formDetail :curItem="item" :qxBtns="qxBtns" :cureId="cureId" :status="status" :patientId="patientId" :allergyList="allergyList"></formDetail>
        </el-tab-pane>
      </el-tabs>
    </div>
    <!-- <iframe ref="iframe1" frameborder="0" height="0px" width="0px" src="/print/cure.html"></iframe> -->
  </section>
</template>
<script>
export default {
  components: {
    patientBasicInfo: () => import("@/pages/_com/patientBasicInfo.vue"),
    formDetail: () => import("./_com/formDetail.vue")
  },
  data() {
    return {
      qxBtns: {},
      cureId: "",
      patientId: "",
      status: "",
      dataList: [],
      allergyList:[]
    };
  },
  created() {
    let th = this;
    let query = th.$route.query;
    th.verifyUrlAttack(query).then(res => {
      th.cureId = th.jieMi(query.cureId);
      th.patientId = th.jieMi(query.patientId);
      th.status = query.status;
      th.getQX();
      th.getData();
    });
  },
  mounted() {
    let th = this;
  },
  methods: {
    //查询检查中
    getData() {
      let th = this;
      let j = {
        cureId: th.cureId,
        status: th.status
      };
      th.$api.cureAssistchecking(j).then(res => {
        if (res.executed) {
          th.dataList = res.data;
        }
      });
    },
    //获取过敏史
    getAllergy(patient,sign,allergy){
       this.allergyList=allergy;
    },
  }
};
</script>
